package com.internetCafes.spms.web.certificate.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.internetCafes.spms.common.utils.DateUtils;

import java.io.Serializable;
import java.util.Date;


/**
 * 证书延期信息
 * 
 * @author Sunny
 * @email rekeeper2011@hotmail.com
 * @date 2019-10-31 18:10:59
 */
public class CertificateRenewalInfo implements Serializable {

	private static final long serialVersionUID = 1L;
	
    /**
     * 本表ID
     */
	private Long id;

    /**
     * 租户id
     */
	private Long tenantId;

    /**
     * 证书ID
     */
	private Long certificateId;

    /**
     * 延期日期
     */
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date renewalTime;

    /**
     * 有效期开始时间
     */
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date validityStartTime;

    /**
     * 有效期结束时间
     */
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date validityEndTime;

    /**
     * 备注信息
     */
	private String remark;

    /**
     * 创建者
     */
	private Long createBy;

    /**
     * 创建时间
     */
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date createTime;

    /**
     * 更新人
     */
	private Long updateBy;

    /**
     * 更新时间
     */
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date updateTime;

	/**
	 * 延期费用
	 */
	private double renewalFee;

	public CertificateRenewalInfo(){}
	public CertificateRenewalInfo(Long tenantId, Long certificateId, Date renewalTime, Date validityStartTime, Date validityEndTime, String remark) {
		this.tenantId = tenantId;
		this.certificateId = certificateId;
		this.renewalTime = renewalTime;
		this.validityStartTime = validityStartTime;
		this.validityEndTime = validityEndTime;
		this.remark = remark;
		this.createTime = new Date();
	}

	public double getRenewalFee() {
		return renewalFee;
	}

	public void setRenewalFee(double renewalFee) {
		this.renewalFee = renewalFee;
	}

	@JSONField(name = "id")
	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}

	@JSONField(name = "tenant_id")
	public void setTenantId(Long tenantId) {
		this.tenantId = tenantId;
	}

	public Long getTenantId() {
		return tenantId;
	}

	@JSONField(name = "certificate_id")
	public void setCertificateId(Long certificateId) {
		this.certificateId = certificateId;
	}

	public Long getCertificateId() {
		return certificateId;
	}

	@JSONField(name = "renewal_time")
	public void setRenewalTime(Date renewalTime) {
		this.renewalTime = renewalTime;
	}

	public Date getRenewalTime() {
		return renewalTime;
	}

	@JSONField(name = "validity_start_time")
	public void setValidityStartTime(Date validityStartTime) {
		this.validityStartTime = validityStartTime;
	}

	public Date getValidityStartTime() {
		return validityStartTime;
	}

	@JSONField(name = "validity_end_time")
	public void setValidityEndTime(Date validityEndTime) {
		this.validityEndTime = validityEndTime;
	}

	public Date getValidityEndTime() {
		return validityEndTime;
	}

	@JSONField(name = "remark")
	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getRemark() {
		return remark;
	}

	@JSONField(name = "create_by")
	public void setCreateBy(Long createBy) {
		this.createBy = createBy;
	}

	public Long getCreateBy() {
		return createBy;
	}

	@JSONField(name = "create_time")
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getCreateTime() {
		return createTime;
	}

	@JSONField(name = "update_by")
	public void setUpdateBy(Long updateBy) {
		this.updateBy = updateBy;
	}

	public Long getUpdateBy() {
		return updateBy;
	}

	@JSONField(name = "update_time")
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	@Override
	public String toString() {
		return "延期日期:" + DateUtils.format(renewalTime) + "，新有效期起止时间："+ DateUtils.format(validityStartTime) + "至" + DateUtils.format(validityEndTime) +"，备注:"+ remark + "；";
	}
}
